﻿@{
    ViewBag.ParentUrl = "/Order/Print";
    ViewBag.Title = "打印调试";
}
@section header{
    <script language="javascript" src="/js/LodopFuncs.js"></script>
    <style>
        .profile-info-name {
            width: auto;
        }
    </style>
}
@section breadcrumb
{
    <ul class="breadcrumb">
        <li>
            <i class="ace-icon fa fa-home home-icon"></i>
            <a href="/">首页</a>
        </li>
        <li class="active">@ViewBag.Title</li>
    </ul><!-- .breadcrumb -->
}

<div class="row">
    <div class="col-xs-12">

        <div class="widget-box">
            <div class="widget-header widget-header-flat">
                <h4 class="smaller">
                    <i class="icon-search"></i>
                    @ViewBag.Title
                </h4>
            </div>

            <div class="widget-body">
                <div class="widget-main">
                    <div class="profile-user-info profile-user-info-striped">
                        <div class="profile-info-row">
                            <div class="profile-info-name"> 打印控件： </div>

                            <div class="profile-info-value">
                                <a  href="javascript:CheckIsInstall();">点击查看是否安装成功</a>
                                &nbsp;&nbsp;&nbsp;
                                <a href="~/static/plugin/install_lodop.zip">【下载安装】</a>
                            </div>
                        </div>
@**@
@*                        <div class="profile-info-row">*@
@*                            <div class="profile-info-name"> 打印机： </div>*@
@**@
@*                            <div class="profile-info-value">*@
@*                                <a href="javascript:TestPrint();">【打印测试】</a>*@
@*                            </div>*@
@*                        </div>*@

                        <div class="profile-info-row">
                            <div class="profile-info-name"> 打印偏移量： </div>

                            <div class="profile-info-value">
                                <form class="form-inline">
                                    <label class="inline">
                                        <span class="lbl">左边距</span>
                                    </label>
                                    <input type="text" class="input-small" placeholder="左边距" id="left">
                                    <label class="inline">
                                        <span class="lbl">毫米 | </span>
                                    </label>
                                    <label class="inline">
                                        <span class="lbl">上边距</span>
                                    </label>
                                    <input type="text" class="input-small" placeholder="上边距" id="top">
                                    <label class="inline">
                                        <span class="lbl">毫米</span>
                                    </label>
                                    <a href="javascript:TestPrint();">【打印测试】</a>
@*                                    <button type="button" class="btn btn-info btn-sm">*@
@*                                        <i class="ace-icon fa fa-save bigger-110"></i>保存*@
@*                                    </button>*@
                                </form>
                            </div>
                        </div>

                        <div class="profile-info-row">
                            <div class="profile-info-name"> 身份证阅读器： </div>

                            <div class="profile-info-value">
                                <a href="~/static/plugin/readCardUsb.rar">驱动下载</a>
                                &nbsp;&nbsp;&nbsp;
                                <a href="~/static/plugin/readCard.exe">【控件下载】</a>
                            </div>
                        </div>

                    </div>

                </div>
            </div>
        </div>
    </div>
</div>

@section footer{
    <script language="javascript" type="text/javascript">

        var LODOP; //声明为全局变量 
        function CheckIsInstall() {
            try {
                var LODOP = getLodop();
                if (LODOP.VERSION) {
                    if (LODOP.CVERSION)
                        alert("当前有C-Lodop云打印可用!\n C-Lodop版本:" + LODOP.CVERSION + "(内含Lodop" + LODOP.VERSION + ")");
                    else
                        alert("本机已成功安装了Lodop控件！\n 版本号:" + LODOP.VERSION);

                };
            } catch (err) {
            }
        };


        function TestPrint() {
            var LODOP = getLodop();
            var top = $('#top').val();
            var left = $('#left').val();

            LODOP.SET_PRINT_STYLE("FontSize", 11);
            LODOP.PRINT_INIT(top, left, 0, 0, "打印测试");
            LODOP.ADD_PRINT_RECT(top, left, 400, 220, 0, 1);
            LODOP.ADD_PRINT_TEXT(top, left, 276, 89, "系统打印测试");
            LODOP.SET_PRINT_STYLEA(2, "FontName", "隶书");
            LODOP.SET_PRINT_STYLEA(2, "FontSize", 15);
            LODOP.PREVIEW();
        };

    </script>
}